const {db} = require("../db/db.js");

exports.addUser = function(entity, cb) {
    db.run("insert into tb_user (id, secret_key) values (1, ?)", [entity.secretKey], cb);
}

exports.updateUser = function(entity, cb) {
    db.run("update tb_user set secret_key = ? where id = 1", [entity.secretKey], cb);
}

exports.getUser = function(cb) {
    db.get("select id, username, password, secret_key as secretKey from tb_user where id = 1", cb);
}
